import api from '../utils/apiBase.js'
import { APP_UPLOAD_BASEURL } from '../app/config.js'

class UploadService {
    /**
     * 文件上传
     * @param {*} file
     * @returns {Promise<{code: number, data: *, message: string}>}
     */
    async upload(file) {
        const filePath = `${APP_UPLOAD_BASEURL}/uploads/${file.filename}`
        return api.success(filePath)
    }
}

export default new UploadService()
